package order

import (
	"context"
	"git.900sui.cn/kc/rpcinterface/interface/common"
)

//获取共享卡包信息-综合卡、身份卡 出参
type ReplyGetCardPackageForShare struct {
	BusId         int
	ShopId        int
	OrderType     int     //3=综合卡、7=充值卡
	Price         float64 //面值
	ConsumePrice  float64 //消费金额(面值)
	Discount      float64 //原卡折扣
	FirstDiscount float64 //第一次卡时的折扣（只对充值卡有效）
	CardId        int     //卡项id
	CardPackageId int     //卡包id
	Uid           int     //卡包所属用户id
	CanShare      int     //是否开启共享 0=否 1=是
	Status        int     //卡包状态
}

//批量获取卡包信息
type ArgsGetCardPackageInfos struct {
	RelationIds []int //卡包关联Id
}

//批量获取卡包信息返回值
type ReplyGetCardPackageInfos struct {
	CardInfos map[int]GetCardPackageInfos //卡包信息 map[relationId]GetCardPackageInfos
}

//卡包信息
type GetCardPackageInfos struct {
	RelationId    int     //卡包关联Id
	CardName      string  //卡项名
	CardType      int     //卡项类型
	CardId        int     //卡项id
	Discount      float64 //原始折扣
	FirstDiscount float64 //第一次卡时的折扣（只对充值卡有效）
	Balance       float64 //剩余余额
	ImgId         int     //图片id
}

//确认消费需要的参数格式
type ArgsShareConsumeService struct {
	ShopId            int             //店铺id
	UId               int             //用户id
	ConsumePrice      float64         //确认消费金额
	Singles           []ConsumeSingle //消费的单项目数据
	Goods             []ConsumeGood   //消费的实物产品
	PackageRelationId int64           //卡包主表id 可删除字段
	FrozenId          int             //卡包冻结id 共享卡消费时用
}

//共享卡包详情-入参
type ArgsShareCardPackageInfo struct {
	common.Utoken     //用户信息
	ShopId        int //消费门店ID【可不传】
	RelationId    int //卡包关联ID
}
type ShareCardInfo struct {
	RealPrice          float64 //实际金额
	Price              float64 //面值金额
	ConsumePrice       float64 //消费面值金额
	FrozenPrice        float64 //冻结的面值
	ActualConsumePrice float64 //实际消费金额
	DisaccountType     int     //1=购卡面值打折 2=项目打折
	FirstDiscount      float64 //第一次购卡的折扣率
	ShareDiscount      float64 //共享卡折扣
	InsuranceChannel   int     //保险渠道
	CardName           string  //卡名称
	CardId             int     //卡ID
	ImgId              int     //卡封面
	PayTime            int64   //付款日期时间戳
	PayTimeStr         string  //付款日期
	ServicePeriod      int     //周期
	CanShare           int     // 是否开启共享 0=否 1=是
}

//共享卡包详情-出参
type ReplyShareCardCardPackageInfo struct {
	CardBasic ReplyCommonCardPackageInfo
	CardInfo  ShareCardInfo
}

type Share interface {
	//获取共享卡包信息-综合卡、身份卡
	GetCardPackageForShare(ctx context.Context, relationId int, reply *ReplyGetCardPackageForShare) error
	//共享卡包详情
	GetShareCardPackageInfo(ctx context.Context, args *ArgsShareCardPackageInfo, reply *ReplyShareCardCardPackageInfo) error
}
